package com.example.springboot3.controller;

import com.example.springboot3.entity.App;
import com.example.springboot3.mapper.AppMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author scout.du
 * @date 2025/07/08 17:26
 **/
@RestController
public class HelloController {

    @Autowired
    AppMapper appMapper;

    @GetMapping("/hello")
    public String hello(){

        App app = appMapper.selectById(7);
        System.out.println(app);
        return "hello";
    }

    @PostMapping("/ppa-message-service/myporsche/v1/notice/push")
    public String hello1(){

        App app = appMapper.selectById(7);
        System.out.println(app);
        if (app!=null){
            throw new RuntimeException("111");
        }
        return "hello";
    }
}
